import Vue from 'vue';
import axios from './router/axios';
import VueAxios from 'vue-axios';
import App from './App';
import router from './router/router';
import './permission'; // 权限
import './error'; // 日志
import './cache';//页面缓冲
import store from './store';
import {loadStyle} from './util/util'
import * as urls from '@/config/env';
import Element from 'element-ui';
import ElementApiDocs from 'element-api-docs'
import dataV from '@jiaminghi/data-view'
import AvueUeditor from 'avue-plugin-ueditor'
Vue.use(AvueUeditor)
Vue.use(dataV)
Vue.use(ElementApiDocs)
import {
    iconfontUrl,
    iconfontVersion
} from '@/config/env';
import './styles/common.scss';
import basicBlock from './components/basic-block/main'
import basicContainer from './components/basic-container/main'
import AvueFormDesign from '@sscfaith/avue-form-design'

Vue.use(AvueFormDesign)

Vue.use(router)
Vue.use(VueAxios, axios)
Vue.use(Element)
Vue.use(window.AVUE)
Vue.prototype.$notify = Element.Notification
//注册全局容器
Vue.component('basicContainer', basicContainer)
Vue.component('basicBlock', basicBlock)
// 加载相关url地址
Object.keys(urls).forEach(key => {
    Vue.prototype[key] = urls[key];
})

// 动态加载阿里云字体库
iconfontVersion.forEach(ele => {
    loadStyle(iconfontUrl.replace('$key', ele));
})

Vue.config.productionTip = false;
new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')
